<template>
  <el-row class="tac">
    <el-col>
      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="0"
        text-color="#fff"
      >
        <el-sub-menu v-for="item in routes" :key="item.path" :index="item.path">
          <template #title>
            <el-icon><location /></el-icon>
            <span>{{ item.meta?.title }}</span>
          </template>
        </el-sub-menu>
        <!-- <el-menu-item index="2">
          <el-icon><icon-menu /></el-icon>
          <span>Navigator Two</span>
        </el-menu-item>
        <el-menu-item index="3" disabled>
          <el-icon><document /></el-icon>
          <span>Navigator Three</span>
        </el-menu-item>
        <el-menu-item index="4">
          <el-icon><setting /></el-icon>
          <span>Navigator Four</span>
        </el-menu-item> -->
      </el-menu>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import { useRoute } from 'vue-router'

// import {
//   Document,
//   Menu as IconMenu,
//   Location,
//   Setting,
// } from '@element-plus/icons-vue'
let route=useRoute();
let routes=route.matched[0].children
console.log(routes);
</script>


<style lang="scss">
.el-row{
  width: 150px;
}
</style>
